package com.gack.business.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

import com.gack.business.model.StoreAndFacity;

/**
 * 
* @ClassName: StoreAndFacityRepository 
* @Description: TODO(这里用一句话描述这个类的作用) 
* @author (ZhangXinYu)  
* @date 2018年6月5日 下午3:53:33 
* @version V1.0
 */
public interface StoreAndFacityRepository extends JpaRepository<StoreAndFacity, String>{
	@Query("select f.facityid from StoreAndFacity f where f.storeid = :storeid")
	public List<String> getAllStoreFacityids(@Param("storeid")String storeid);
	
	//删除门店对应配套服务
	@Transactional
	@Modifying
	@Query("DELETE FROM StoreAndFacity sf where sf.storeid = :storeid")
	public void dealStoreFacitiesByStoreid(@Param("storeid") String storeid);
}
